lib/repo-refs: Add a flag to exclude listing from refs/mirrors
authorMatthew Leeds <matthew.leeds@endlessm.com>
Thu, 21 Feb 2019 23:39:45 +0000 (15:39 -0800)
committerAtomic Bot <atomic-devel@projectatomic.io>
Mon, 15 Apr 2019 15:56:40 +0000 (15:56 +0000)
commit0ecbc6f2a9ddd6ab9700e98da794eef7290ffdc7
tree13b93c184b6f7baf752518eb3b726e1d4a5b0c8d
parent23304b8c15835e75e257c7eb589808e40f3e39c9
lib/repo-refs: Add a flag to exclude listing from refs/mirrors

Currently the flag OSTREE_REPO_LIST_REFS_EXT_EXCLUDE_REMOTES for
ostree_repo_list_collection_refs() means that refs in refs/remotes/
should be excluded but refs in refs/mirrors/ should still be checked, in
addition to refs/heads/ which is always checked. However in some
situations you want to exclude both remote and mirrored refs and only
check local "owned" ones. So this
commit adds a new flag OSTREE_REPO_LIST_REFS_EXT_EXCLUDE_MIRRORS which
lets you exclude refs/mirrors/ from the listing.

This way we can avoid breaking API but still allow the listing of local
collection-refs.

The impetus for this change is that I'm changing Flatpak to make more
use of refs/mirrors, and we need a way to specify that a collection-ref
is local when using ostree_repo_resolve_collection_ref() in, for
example, the implementation of the repo command. The subsequent commit
will make the changes needed there.

Closes: #1825
Approved by: jlebon
src/libostree/ostree-repo-refs.c
src/libostree/ostree-repo.h